import * as actionType from '../../my/store/constants.js';
import {
    reqmy
} from '../../../api/index'

export const getMyData = () => {
    console.log('进去了');
    return (dispatch) => {
        reqmy()
            .then((res) => {
                // console.log(res,'999999');
                // console.log(res.data.data.user[0],'123456');
                // console.log(res.data.data.category[0].result.branditems,'djlksajflkdsjalk');
                dispatch(changeMyData(res.data.data.user[0]))
            })
            .catch((e) => {
                console.log('出错了');
            })
    }
}

export const changeMyData = (data) => {
    // console.log(data,'0000000');
    return {
        type: actionType.CHANGE_MY,
        data:data
    }
}

